<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商户优惠信息列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="商户优惠信息列表">
	<%@include file="/includes/jsp/base.jsp" %>
	<script type="text/javascript">
		function add(){
			
		}
		
		function del(id){
			window.location.href=JB.calUrl("discounts/discounts_deleteDiscounts.action?discounts.id=" + id);
		}
		
		function disp(){
			
		}
		function doQuery(){
			var url = JB.calUrl("discounts/discounts_queryListDiscounts.action");
			var shopName = document.getElementById('discounts.shopname').value;
			var type = document.getElementById('discounts.type').value;
			if(shopName != ''){
				url += url + '?discounts.shopName=' + shopName;
				if(type != ''){
					url += '&discounts.type=' + type;
				}
			}else if(type != ''){
				url += url + '?discounts.type=' + type;
			}
			window.location.href = url;
		}
	</script>

  </head>
  
  <body>
    <s:form name="form1" id="form1">
    	<table width="100%">
    		<tr>
    			<td width="80%">
    				<table width="100%">
			    		<tr>
			    			<td>
			    				商户名称:
			    			</td>
			    			<td>
			    				类型:
			    			</td>
			    		</tr>
			    		<tr>
			    			<td>
			    				<input type="text" name="discounts.shopName" id="discounts.shopName"/>
			    			</td>
			    			<td>
			    				<select name="discounts.type" id="discounts.type">
			    					<option value="">--全部--</option>
			    					<option value="K1">美食（特色、小吃、酒店）</option>
			    					<option value="K2">家居（装修、建材）</option>
			    					<option value="K3">数码（手机、电脑、相机）</option>
			    					<option value="K4">服装（服装、帽、鞋、包、帽）</option>
			    					<option value="K5">休闲 (KTV、酒吧、洗浴)</option>
			    					<option value="K6">美容（健身、SAP)</option>
			    					<option value="K7">房产（品牌地产、二手房）</option>
			    					<option value="K8">户外（旅行社、野郊、暴走）</option>
			    				</select>
			    			</td>
			    		</tr>
			    	</table>
    			</td>
    			<td width="20%">
    				<table>
    					<tr>
    						<td>
    							<button onclick="doQuery()">查找</button>
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td>
    				<table width="100%">
			    		<thead align="center">
			    			<tr>
			    				<th style="width:60;">
			    					<input type="checkbox" onclick="alls()" style="height: 15px" id="checkall" />
			    				</th>
			    				<th>
			    					商户名称
			    				</th>
			    				<th>
			    					地址
			    				</th>
			    			</tr>
			    		</thead>
			    		<tbody>
			    			<s:iterator value="discountList">
			    				<tr align="center">
			    					<s:url id="detail" action="discounts/discounts_queryDiscounts" includeParams="false">
										<s:param name="id" value="id"></s:param>
									</s:url>
									<td style="width:60">
										<input type="checkbox" name="ids" value="${id}" id="ids" />
									</td>
			    					<td>
			    						<s:a href="%{detail}">
			    							<s:property value="shopName"/>
			    						</s:a>
			    					</td>
			    					<td>
			    						<s:property value="address"/>
			    					</td>
			    					<td>
			    						<button onclick="del('${id}')" >删除</button>
			    					</td>
			    				</tr>
			    			</s:iterator>
			    		</tbody>
			    	</table>
    			</td>
    			<td>
    				
    			</td>
    		</tr>
    	</table>
    </s:form>
  </body>
</html>
